package com.museum.controller.impl.admin;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseResponse;
import com.museum.controller.api.admin.AdminPermissionAPI;
import com.museum.service.impl.PermissionService;
import com.museum.service.impl.admin.AdminPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @ClassName museum
 * @Author: 王瑞文
 * @Date: 2020/12/28 18:43
 */
@RestController
@RequestMapping("/super/permission")
public class AdminPermissionController implements AdminPermissionAPI {
    @Autowired
    private AdminPermissionService adminPermissionService;

    @Override
    public BaseResponse<JSONObject> getAllPermission() {
        return adminPermissionService.getAllPermission();
    }

    @Override
    public BaseResponse<JSONObject> closePermission(Integer permissionId) {
        return adminPermissionService.closePermission(permissionId);
    }

    @Override
    public BaseResponse<JSONObject> openPermission(Integer permissionId) {
        return adminPermissionService.openPermission(permissionId);
    }
}
